package com.hotdog.service;

import com.hotdog.feign.LogsFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;

import java.util.Collection;

/**
 * 目前只实现入库操作
 * @author 郭鲁政
 */
@Service
public class VipViewServiceImpl implements VipViewService{
    @Autowired
    private LogsFeignClient logsFeignClient;
    @Override
    public void logs() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        Collection<? extends GrantedAuthority> authorities = authentication.getAuthorities();//获取权限信息
        String name = authentication.getName();
        logsFeignClient.logs(name, "vipview");
    }
}
